<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Modeling</title>
{:importCSS("template.css|style.css|person.css|person-profile.css|font.css")}
{:importJS("jquery.min.js|input.js|signup.js")}
<!-- Plugin -->
<link rel="stylesheet" href="__ROOT__/themes/fancybox/jquery.fancybox-1.3.4.css" type="text/css" media="screen" />
<link rel="stylesheet" type="text/css" href="__ROOT__/themes/uploadify/uploadify.css" />
<script type="text/javascript" src="__ROOT__/themes/uploadify/jquery.uploadify.min.js"></script>
<script type="text/javascript">
$().ready(function () {
	$('#countrybutton').fancybox({
		'margin'	:	0,
		'padding'	:	0,
		'width'	:	500,
	});
	$('#file_upload').uploadify({
        'swf'      : '__ROOT__/themes/uploadify/uploadify.swf',
        'uploader' : '{:U("User/uploadAvatar")}?swfk={$ukver}',
        'onUploadSuccess' : function(file, data, response) {
        	data = JSON.parse(data);
        	if (data.error) {
        		alert(data.msg);
        	} else {
        		$("._avatar").attr("src","__ROOT__/data/avatars/thumb_"+data.msg);
        	}
        	
        }
	}).uploadify('settings','buttonText','{:L('PERSON_SELECTFILE')}');
});
</script>
<!-- Plugin -->
</head>
<body>
<include file="public:header" />
<div class="main center clearfix profile">
	<div class="leftbox">
    	<include file="userleftinfo" />
        <div class="clear"></div>
        <include file="usermenu" />
	</div>
    <form method=post>
    <table class="rightbox">
        <tr class="buttons">
        	<td colspan="2">
            	<a href="javascript:void(0);" id="open_ao" onclick="jQuery('#open_ao').hide();jQuery('#close_ao').show();jQuery('.edit').hide();jQuery('.com').show();"><div class="button">{:L('PERSON_EDIT_FOLLOWING')}</div></a>
                <!--<a href="javascript:void(0);" style="display:none;" id="close_ao" onclick="jQuery('#close_ao').hide();jQuery('#open_ao').show();jQuery('.com').hide();jQuery('.edit').show();"><div class="button">COMPLETE</div></a>-->
                <a href="javascript:void(0);" style="display:none;" id="close_ao" onclick="jQuery('form').submit();"><div class="button">{:L('PERSON_COMPLETE')}</div></a>
            </td>
        </tr>
        <tr class="image edit">
       		<td class="title">{:L('PERSON_IMAGE')} :</td>
        	<td><img src="{:getAvatar($_cUser)}" class="_avatar"/></td>
        </tr>
        <php>
        	$country = M("country")->getFieldByCode($_cUser["country"],L('COUNTRY_LANG'));
        </php>
        <tr class="country edit">
        	<td class="title">{:L('PERSON_COUNTRY')} :</td>
        	<td>{$country}</td>
        </tr>
        <tr class="number edit">
        	<td class="title">{:L('PERSON_TELEPHONE')} :</td>
        	<td>{:h(xserialize($_cUser['contact'],'tel'))}</td>
        </tr>
        <tr class="im edit">
        	<td class="title">IM(QQ&MSN) :</td>
        	<td>{:h(xserialize($_cUser['contact'],'im'))}</td>
        </tr>
        <tr class="type edit">
        	<td class="title">{:L('PERSON_TYPES')} :</td>
        	<td><a href="###"><div class="button">{:$_cUser['usertype']?L(M("cgtype")->getFieldById($_cUser['usertype'],"cgtypename")):""}</div></a></td>
        </tr>
        <tr class="skill edit">
        	<td class="title">{:L('CONTRACTOR_SKILLS')} :</td>
        	<td id="skill_view"></td>
        </tr>
        <tr class="about edit">
        	<td class="title">{:L('PERSON_ABOUT')} :</td>
        	<td>{$_cUser.intro|h}</td>
        </tr>
        
        <tr class="image com">
       		<td class="title">{:L('PERSON_IMAGE')} :</td>
        	<td><img src="{:getAvatar($_cUser)}" class="_avatar" /> <br />
        	<input type="file" name="file_upload" id="file_upload" /></td>
        </tr>
        <tr class="country com">
        	<td class="title">{:L('PERSON_COUNTRY')} :</td>
        	<td>
            	<div class="box">
                	<div id="countryname" class="country">{$country}</div>
            		<a id="countrybutton" href="#countrybox"><div class="button"></div></a>
            		<div class="hide"><include file="public:countrybox" /></div>
            		</div></div>
    			</div>
            </td>
        </tr>
        <tr class="number com">
        	<td class="title">{:L('PERSON_TELEPHONE')} :</td>
        	<td><input type="text" id="tel" name="tel" value="{:h(xserialize($_cUser['contact'],'tel'))}" onfocus="setStyleOne(this.id)" onblur="setStyleTwo(this.id)"  onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')" /></td>
        </tr>
        <tr class="im com">
        	<td class="title">IM(QQ&MSN) :</td>
        	<td><input type="text" id="im" name="im" value="{:h(xserialize($_cUser['contact'],'im'))}" onfocus="setStyleOne(this.id)" onblur="setStyleTwo(this.id)"/></td>
        </tr>
        <tr class="type com">
        	<td class="title">{:L('PERSON_TYPES')} :</td>
        	<td class="typetd">
            <div id="dropDownList1" class="dropDownList dropdown">
  				<select class="hide" name="usertype">
                    <option value="0">{:L('WORK_PLEASE_SELECT')}</option>
   					<php> $cgtype = M("cgtype")->order("`order` asc")->select();</php>
                    <volist name="cgtype" id="data">
   					<option value="{$data.id}" {:(($data['id']==$_cUser['usertype'])?"selected":"")}>{:L($data['cgtypename'])}</option>
   					</volist>
  				</select>
  				<span class="">{:($_cUser['usertype']?L(M("cgtype")->getFieldById($_cUser['usertype'],"cgtypename")):L('WORK_PLEASE_SELECT'))}</span>
            	<ul class="">
            	</ul>
        	</div>
            </td>
        </tr>
        <tr class="skill com">
        	<td class="title">{:L('CONTRACTOR_SKILLS')} :</td>
        	<td><input type="hidden" name="skill" id="skill_data" value="{$_cUser.userskill}" /><include file="public:skilleditor" /></td>
        </tr>
        <tr class="about com">
        	<td class="title">{:L('PERSON_ABOUT')} :</td>
        	<td><textarea type="text" id="about" name="intro" onfocus="setStyleOne(this.id)" onblur="setStyleTwo(this.id)">{$_cUser.intro|h}</textarea></td>
        </tr>
    </table>
    <input type="hidden" name="_submit" value="1"/>
    </form>
</div>
<include file="public:footer" />
{:importJS("downlist.js")}
<script type="text/javascript" src="__ROOT__/themes/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
</body>
</html>


